<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../public/css/reset.css">
    <link rel="stylesheet" href="../public/css/index.css">
    <style>
        html,
        body {
            width: 100%;
            height: 100%
        }

        .fr {
            float: right;
        }

        .w100 {
            width: 100%;
        }

        .h100 {
            height: 100%;
        }

        .bc {
            background-color: rgb(84, 92, 100);
        }

        .el-header {
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="app">

        <el-row>
            <el-button type="primary" @click="showDialog">提交新事务</el-button>
        </el-row>
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="所有事务" name="first">所有事务</el-tab-pane>
            <el-tab-pane label="尚未处理" name="second">

                <el-table :data="tableData4" style="width: 100%" max-height="600">
                    <el-table-column fixed prop="date" label="日期" width="150">
                    </el-table-column>
                    <el-table-column prop="name" label="标题">
                    </el-table-column>
                    <el-table-column prop="province" label="发起人" width="100">
                    </el-table-column>
                    <el-table-column prop="city" label="受理人" width="100">
                    </el-table-column>
                    </el-table-column>
                    <el-table-column fixed="right" label="操作">
                        <template slot-scope="scope">
                            <el-button @click.native.prevent="deleteRow(scope.$index, tableData4)" type="text" size="small">
                                编辑
                            </el-button>
                            <el-button @click.native.prevent="deleteRow(scope.$index, tableData4)" type="text" size="small">
                                移除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>

                <el-pagination background layout="prev, pager, next" :total="1000" style="float: right;">
                </el-pagination>
            </el-tab-pane>
            <el-tab-pane label="正在处理" name="third">配置管理</el-tab-pane>
            <el-tab-pane label="处理完成" name="fourth">角色管理</el-tab-pane>
            <el-tab-pane label="丢弃事务" name="five">定时任务补偿</el-tab-pane>
        </el-tabs>
        <el-dialog title="新增事务" :visible.sync="dialogFormVisible">
            <el-form :model="form">
                <el-form-item label="事务标题" :label-width="formLabelWidth">
                    <el-input v-model="form.title" auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="时间选择" :label-width="formLabelWidth">
                    <el-date-picker v-model="form.datetime" type="datetime" placeholder="选择日期时间">
                    </el-date-picker>
                </el-form-item>

                <el-form-item label="发起人：" :label-width="formLabelWidth">
                    <el-select v-model="form.whoPublish" placeholder="选择发起人">
                        <el-option label="茅开彬" value="shanghai"></el-option>
                        <el-option label="康昌亮" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="受理人：" :label-width="formLabelWidth">
                    <el-select v-model="form.whoHandle" placeholder="选择受理人">
                        <el-option label="茅开彬" value="shanghai"></el-option>
                        <el-option label="康昌亮" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="事务状态" :label-width="formLabelWidth">
                    <el-select v-model="form.style" placeholder="请选择事务状态">
                        <el-option label="尚未处理" value="shanghai"></el-option>
                        <el-option label="正在处理" value="beijing"></el-option>
                        <el-option label="处理完成" value="beijing"></el-option>
                        <el-option label="丢弃事务" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="是否私密" :label-width="formLabelWidth">
                    <el-select v-model="form.openOr" placeholder="选择受理人">
                        <el-option label="公开事务" value="shanghai"></el-option>
                        <el-option label="私密事务" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="详情情况" :label-width="formLabelWidth">
                    <el-input type="textarea" v-model="form.desc"></el-input>
                </el-form-item>
                <el-form-item label="上传图片" :label-width="formLabelWidth">
                    <el-upload action="https://www.baidu.com" list-type="picture-card" :on-preview="handlePictureCardPreview"
                        :on-remove="handleRemove" :auto-upload="false">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible">
                        <img width="100%" :src="dialogImageUrl" alt="">
                    </el-dialog>
                </el-form-item>


            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
            </div>
        </el-dialog>
    </div>

</body>
<script src="../public/js/vue.js"></script>
<!-- 引入组件库 -->
<script src="../public/js/index.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data() {
            return {
                activeName: 'first',
                form: {
                    title: "",
                    datetime: "",
                    whoPublish: "",
                    whoHandle: "",
                    style: "",
                    openOr: ""
                },
                tableData4: [{
                    date: '2016-05-03',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-02',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-08',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-06',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-07',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }],
                dialogFormVisible: false,
                formLabelWidth: '120px',
                dialogImageUrl: '',
                dialogVisible: false
            }
        },
        methods: {
            showDialog() {
                this.dialogFormVisible = !this.dialogFormVisible;
            },
            // 切换事件
            handleClick() {

            },
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            }
        }
    })
</script>

</html>